const faker = require('faker');

faker.locale = 'zh_CN';

const crsTypeSelect = [{ value: 0, name: '类别0' }, { value: 1, name: '类别1' }];
const crsFormSelect = [{ value: 0, name: '线上自学' }, { value: 1, name: '线上直播' }, { value: 2, name: '线下' }];
const agencySelect = [{ value: 0, name: '培训机构0' }, { value: 1, name: '培训机构1' }];
const teacherSelect = [{ value: 0, name: '王晓天' }, { value: 1, name: '董京国' }];
const assignerSelect = [{ value: 0, name: '刘会瓦' }, { value: 1, name: '林栋梁' }];
// 课程列表
const courseList = [];
for (let i = 0; i < 20; i++) {
  courseList.push({
    id: faker.random.uuid(),
    name: faker.random.words(),
    unionName: faker.random.words(),
    unionId: faker.random.uuid(),
    courceName: faker.random.words(),
    courceId: faker.random.uuid(),
    type: Math.floor(Math.random() * crsTypeSelect.length),
    form: Math.floor(Math.random() * crsFormSelect.length),
    address: faker.address.streetName(),
    agency: Math.floor(Math.random() * agencySelect.length),
    teacher: Math.floor(Math.random() * teacherSelect.length),
    assigner: Math.floor(Math.random() * assignerSelect.length),
    trainTime: Date.now(),
    expireTime: Date.now(),
    property: Math.floor(Math.random() * 2),
    comment: '备注'
  });
}
//
const patchList = [];
for (let i = 0; i < 5; i++) {
  const item = {
    name: `附件 - ${i}`,
    url: 'https://www.w3cschool.cn/statics/demosource/movie.mp4'
  };
  patchList.push(item);
}
const courseDetail = {
  id: faker.random.uuid(),
  name: faker.random.words(),
  type: Math.floor(Math.random() * crsTypeSelect.length),
  form: Math.floor(Math.random() * crsFormSelect.length),
  agency: Math.floor(Math.random() * agencySelect.length),
  teacher: Math.floor(Math.random() * teacherSelect.length),
  assigner: Math.floor(Math.random() * assignerSelect.length),
  time: Date.now(),
  desc: '我是课程简介，为了测试多行效果，我就随便输入点文字好了，不要见怪，不要见笑！',
  suitCrowd: '20-30岁',
  code: '上马我来了',
  plan: '计划二',
  duration: `${Math.floor(Math.random() * 200)} 分`,
  publisher: '王二小',
  patchList
};
// 授课任务列表
const taskList = [];
for (let i = 0; i < 20; i++) {
  taskList.push({
    id: faker.random.uuid(),
    name: faker.random.words(),
    type: Math.floor(Math.random() * crsTypeSelect.length),
    assignType: Math.floor(Math.random() * 2),
    form: Math.floor(Math.random() * crsFormSelect.length),
    address: faker.address.streetName(),
    assigner: Math.floor(Math.random() * assignerSelect.length),
    time: Date.now(),
    dutation: `${Math.floor(Math.random() * 200)} 分`,
    property: Math.floor(Math.random() * 2),
    comment: '备注'
  });
}
// 指派列表
const assignList = [];
for (let i = 0; i < 20; i++) {
  assignList.push({
    id: faker.random.uuid(),
    type: Math.floor(Math.random() * 2),
    name: faker.random.words(),
    desc: faker.random.words(),
    version: `1.2.${i}`,
    creator: '汪达尔',
    assigner: Math.floor(Math.random() * assignerSelect.length),
    assignDate: Date.now(),
    expireDate: Date.now(),
    trainCount: Math.floor(Math.random() * 100),
    finishCount: Math.floor(Math.random() * 100)
  });
}

const assignDetail = {
  assignCourse: ['0', '1'],
  assignCycle: '1',
  assignReason: ['0', '2'],
  assignTip: '23',
  assignType: '0',
  cycleType: '0',
  expireDate: new Date(),
  optionStaff: ['0006'],
  requireStaff: ['0001', '0003'],
  tipType: '0'
};

// 培训记录列表
const recordList = [];
for (let i = 0; i < 20; i++) {
  recordList.push({
    id: faker.random.uuid(),
    name: faker.random.words(),
    type: Math.floor(Math.random() * crsTypeSelect.length),
    form: Math.floor(Math.random() * crsFormSelect.length),
    agency: Math.floor(Math.random() * agencySelect.length),
    teacher: Math.floor(Math.random() * teacherSelect.length),
    time: Date.now(),
    status: Math.floor(Math.random() * 2),
    grade: Math.floor(Math.random() * 101),
  });
}
// 内部培训列表
const innerList = [];
for (let i = 0; i < 20; i++) {
  innerList.push({
    id: faker.random.uuid(),
    name: faker.random.words(),
    form: Math.floor(Math.random() * crsFormSelect.length),
    agency: Math.floor(Math.random() * agencySelect.length),
    teacher: Math.floor(Math.random() * teacherSelect.length),
    address: faker.address.streetName(),
    time: Date.now(),
    dutation: `${Math.floor(Math.random() * 200)} 分`,
    status: Math.floor(Math.random() * 3),
    comment: '',
  });
}
// 外部培训列表
const outerList = [];
for (let i = 0; i < 20; i++) {
  outerList.push({
    id: faker.random.uuid(),
    name: faker.random.words(),
    form: Math.floor(Math.random() * crsFormSelect.length),
    agency: Math.floor(Math.random() * agencySelect.length),
    teacher: Math.floor(Math.random() * teacherSelect.length),
    address: faker.address.streetName(),
    time: Date.now(),
    dutation: `${Math.floor(Math.random() * 200)} 分`,
    status: Math.floor(Math.random() * 3),
    comment: '',
  });
}

// 资料库-医械信息
const medicalinfoList = [];
for (let i = 0; i < 20; i++) {
  medicalinfoList.push({
    id: faker.random.uuid(),
    title: faker.name.title(),
    articleType: Math.floor(Math.random() * 3),
    product: Math.floor(Math.random() * 3),
    publishTime: Date.now(),
    publishCompany: Math.floor(Math.random() * 3),
    author: Math.floor(Math.random() * 3),
    arrange: faker.name.lastName(),
  });
}

// 资料库-标准法规
const standardruleList = [];
for (let i = 0; i < 20; i++) {
  standardruleList.push({
    id: faker.random.uuid(),
    standardOrg: faker.name.title(),
    standardCode: faker.random.uuid(),
    standardName: faker.name.jobType(),
    publishTime: Date.now(),
    closeTime: Date.now(),
  });
}

// 资料库-课程库
const treeData = [{
  id: '1',
  name: '全部',
  children: [{
    id: '1-1',
    name: '文件夹A',
    children: [{
      id: '1-1-1',
      name: '子类A1'
    }, {
      id: '1-1-2',
      name: '子类A2'
    }]
  }, {
    id: '1-4',
    name: '文件夹B',
    children: [{
      id: '1-4-1',
      name: '子类B1'
    }, {
      id: '1-4-2',
      name: '子类B2'
    }]
  }, {
    id: '1-6',
    name: '文件夹C',
    children: [{
      id: '1-6-1',
      name: '子类C1'
    }, {
      id: '1-6-2',
      name: '子类C2'
    }]
  }]
}];

//
const courseLibList = [];
for (let i = 0; i < 20; i++) {
  courseLibList.push({
    id: faker.random.uuid(),
    name: faker.name.title(),
    code: faker.random.uuid(),
    type: Math.floor(Math.random() * 2),
    form: Math.floor(Math.random() * 3),
    dataType: faker.system.fileType(),
    trainAgency: Math.floor(Math.random() * 2),
    trainTeacher: Math.floor(Math.random() * 2),
    trainTime: Date.now()
  });
}

// 培训报表
const reportList = [];
for (let i = 0; i < 20; i++) {
  reportList.push({
    id: faker.random.uuid(),
    planCode: faker.random.uuid(),
    planName: faker.name.title(),
    assignor: Math.floor(Math.random() * 3),
    assignorTime: Date.now(),
    expireTime: Date.now(),
    completeTime: Date.now(),
    planNumber: faker.random.number(9999),
    learnNumber: faker.random.number(9999),
    studiedNumber: faker.random.number(9999),
    courseCode: faker.random.uuid(),
    courseName: faker.name.title(),
    employeeId: faker.random.number(99999999),
    name: faker.name.lastName(),
    status: faker.random.number(1),
    score: faker.random.number(100),
  });
}

export default {
  crsTypeSelect,
  crsFormSelect,
  agencySelect,
  teacherSelect,
  assignerSelect,
  //
  courseList,
  courseDetail,
  //
  taskList,
  assignList,
  assignDetail,
  recordList,
  innerList,
  outerList,
  medicalinfoList,
  standardruleList,
  treeData,
  courseLibList,
  reportList
};
